<template>
	<view class="container">
		<template v-for="(item, index) in list">
			<view class="container-box">
				<image :src="item.content.avatar" mode="aspectFill"></image>
				<h1>{{item.content.name}}</h1>
				<text>关注了你</text>
			</view>
		</template>
		
		<!-- 没有商品 -->
		<view class="nodetails" style="height: 510px" v-if="list.length == 0">
		  <view class="nodetails_img">
		    <image src="http://qichong-1256206693-1256206693.cos.ap-nanjing.myqcloud.com/upload/20210617/3a7b53543eb8e61ccf6b16369db10a00.png" mode="widthFix" class="maxImage"></image>
		  </view>
		  <text>去发动态...</text>
		</view>
	</view>
</template>

<script>
	import {
		fans
	} from '@/api/message.js'
	export default {
		data() {
			return {
				list: []
			};
		},
		onLoad() {
			this.fans();
		},
		methods: {
			fans() {
				let that = this;
				fans().then(res => {
					that.list = res.data;
					that.list.forEach(item => {
						if (item.content) {
							item.content = JSON.parse(item.content);
						}
					})
				})
			}
		}
	}
</script>

<style lang="scss">
	.container {
		padding: 0rpx 30rpx;

		.container-box {
			padding: 36rpx 0rpx;
			display: flex;
			align-items: center;
			border-bottom: 1rpx solid #f1f1f1;

			image {
				width: 72rpx;
				height: 72rpx;
				border-radius: 50%;
			}

			h1 {
				color: rgba(61, 61, 61, 1);
				font-size: 30rpx;
				margin: 0 20rpx;
			}

			text {
				color: rgba(61, 61, 61, 0.5);
				font-size: 24rpx;
			}
		}
	}
	
	.nodetails {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		padding-bottom: 128rpx;
	
		.nodetails_img {
			.maxImage {
				width: 184rpx;
				height: 322rpx;
			}
		}
	
		text {
			font-size: 30rpx;
			margin-top: 20rpx;
			color: rgba(61, 61, 61, 0.3);
		}
	}
</style>
